using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Admin_links : System.Web.UI.Page
{
    protected BLL.Admin bll = new BLL.Admin();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != null)
                loadData();
        }
    }

    private void loadData()
    {
        int intBookmarks_Id = 0;
        try { intBookmarks_Id = int.Parse(Request.QueryString["id"]); }
        catch { return; }
        DAL dal = new DAL();
        DataTable dt = dal.getLink(Request.QueryString["id"]);
        if (dt != null)
        {
            txtBookmarks_Id.Value = dt.Rows[0]["bookmarks_Id"].ToString();
            txtURL.Value = dt.Rows[0]["url"].ToString();
            txtTitle.Value = dt.Rows[0]["title"].ToString();
            txtDescription.Value = dt.Rows[0]["description"].ToString();
            if (dt.Rows[0]["target"].ToString() == "1")
                chkTarget.Checked = true;
        }
    }
}
